<div id="mainbody" class="fui-page fui-page-current">
	<div class="fui-content" style="position: absolute;">
		<div ng-show="!use_template" ng-include="main.page" onload="start()"></div>
		<div ng-show="use_template">
				<div class="fui-tab fui-tab-danger" ng-if="pagedata.htmls && pagedata.htmls[0].tabs" style="background:#f7f7f7">
					<a ng-repeat="tab in pagedata.htmls[0].tabs" href="javascript:;" ng-click="access_json(tab)" ng-class="{'item':1,'active':show_active(tab)}">{{check_show_lang(tab.title)}}</a>
				</div>
				<div id="base_template_html"></div>
		</div>
	</div>
</div>
<div ng-if="pagedata.iswelcome!=1" class="floatright-icon-top" style="width:2rem">
	<div class="icon-two" onclick="$('#show_frames').modal();">
			<i class="icon icon-category"></i>
			<div class="title">菜单</div>
	</div>
	<div class="icon-two" ng-click="access_json('core/account.welcome/')">
			<i class="icon icon-qiehuan"></i>
			<div class="title">{{check_show_lang('站点','SYS')}}</div>
	</div>
</div>
<div ng-if="pagedata.iswelcome!=1" class="floatright-icon" style="width:2rem">
	<div class="icon-two" href="{{main.kflink}}">
			<i class="icon icon-atm"></i>
			<div class="title">客服</div>
	</div>
	<div class="icon-two"  ng-click="access_json('core/account.siteinfo/')">
			<i class="icon icon-wo1"></i>
			<div class="title">{{username}}</div>
	</div>
	<div class="icon-two" ng-click="access_json('core/home.welcome/')">
			<i class="icon icon-shouye"></i>
			<div class="title">{{check_show_lang('前端','Welcome')}}</div>
	</div>
	<div class="icon-two" ng-click="post_json({'plugin':'core','action':'user.logout','message':'确定退出吗？'})">
			<i class="fa fa-power-off"></i>
			<div class="title">{{check_show_lang('退出','Out')}}</div>
	</div>
	<div ng-if="pagedata.show_userset" class="icon-two" ng-click="access_json('core/account.user/')">
			<i class="icon icon-shouye"></i>
			<div class="title">{{check_show_lang('我的账号','my info')}}</div>
	</div>
	<div ng-if="pagedata.show_userset" class="icon-two" ng-click="access_json(main.welcomeaction)">
			<i class="icon icon-shouye"></i>
			<div class="title">{{check_show_lang('返回系统','Go sys')}}</div>
	</div>
</div>
<!--<div ng-if="framess[current_menu].length>0" class="fui-navbar" style="overflow-y:hidden;overflow-x:scroll;width:auto;">
    <a ng-repeat="menu in framess[current_menu]" id="top_nav_item_{{$index}}" ng-class="{'external nav-item':1,'active':menu==frames}" ng-click="active(menu);access_json(menu.url)">
        <span class="icon {{menu.fa || 'icon-all'}}"></span>
        <span class="label" style="color: #000000;">{{check_show_lang(menu.title)}}</span>
    </a>
</div>-->
<div ng-if="pagedata.iswelcome!=1" class="fui-navbar">
    <a  href="javascript:;" ng-click="access_json(pagedata.manage_plugin+'/basic.module_home/')" ng-class="{'external nav-item':1,'active':show_active(pagedata.manage_plugin+'/basic.module_home/')}">
		<span class="icon icon-shouye"></span>
        <span class="label">首页</span>
    </a>
	<a href="javascript:;" ng-click="access_json('core/member.member/')" ng-class="{'external nav-item':1,'active':show_active('core/member.member/')}">
		<span class="icon icon-paihao0"></span>
        <span class="label">会员</span>
    </a>
	<a href="javascript:;" ng-click="access_json('core/basic.module_home//child_action=basic.welcome')" ng-class="{'external nav-item':1,'active':pagedata.child_action=='basic.welcome'}">
		<span class="icon icon-xiaochengxu"></span>
        <span class="label">小程序</span>
    </a>
	<a href="javascript:;" ng-click="access_json('core/home.plugin_home/')" ng-class="{'external nav-item':1,'active':show_active('core/home.plugin_home/')}">
		<span class="icon icon-yingyongbao"></span>
        <span class="label">应用</span>
    </a>
	<a href="javascript:;" ng-click="access_json('core/account.welcome/')" ng-class="{'external nav-item':1,'active':show_active('core/account.welcome/')}">
		<span class="icon icon-zhandianshezhi"></span>
        <span class="label">站点</span>
    </a>
</div>
<div id="show_frames" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:20%;top:0">
<div class="fui-page fui-page-current" style="background:#fff">
	<div class="fui-header" style="background:#fff">
			<div class="title" style="padding:0.3rem">
				<form method="post">
						<div class="searchbar searchbar-active">
							<div class="search-input">
								<i class="icon jinyunicon icon-search" style="font-size: 0.8rem;"></i>
								<input type="search" id="search" ng-model="main.find_keyword" placeholder="输入菜单名称搜索" style="font-size:0.65rem;background-color:#f2f2f2;border:0 solid #ddd">
							</div>
						</div>
				</form>
			</div>
	</div>
	<!--系统菜单 -->
	<div ng-if="frames.child" class="nav-system">
		<div ng-repeat="(fr,frame) in frames.child"  name="menu">
			<div class="nav-top" ng-click="toogle(frame,'show')">
				<a class="bold"><i class="icon {{frame.fa || 'icon-all'}}" style="margin-right: 8px;"></i>{{check_show_lang(frame.title)}}<i class="fa fa-angle-down pull-right setting" style="font-size:1rem"></i></a>
			</div>
			<ul ng-if="frame.child" class="nav-ul" ng-show="!frame.show" style="">
				<li class="nav-li" ng-repeat="(li,link) in frame.child" ng-show="!main.find_keyword || link.title.indexOf(main.find_keyword)>=0" ng-class="{'active':show_active(link)}">
					<a ng-click="access_menu(link)" id="left_menu_{{fr}}_{{li}}" href="javascript:;">{{check_show_lang(link.title)}}</a>
				</li>
			</ul>
		</div>
	</div>
</div>
</div>
</div>
<script>
//点击顶部菜单，显示左侧菜单
	scope.active=function(menu){
		if(menu.child && menu.child!=[]){
			scope.frames=menu;
		}
	}
	//高亮当前按钮
	
	//加入快捷方式
	scope.to_quick=function(){
		if(scope.page.action=='account.welcome' && scope.page.plugin=='core'){
			scope.message('欢迎界面不支持加入快捷方式！','warning');
			return false;
		}
		//
		
		var post={'data':scope.page,'op':'add_quick','plugin':'core','action':'account.welcome'};
		post.callback=function(res){
			if(res.type=='success'){
				scope.getmodal('account.welcome','set_quick','id='+res.id,'','core');
			}else{
				scope.message('加入快捷方式失败，请联系管理员！');
			}
		}
		scope.post_json(post);
	}
scope.access_menu=function(menu){
	$('#show_frames').modal('hide');
	setTimeout(function(){
		if(menu.url){
			scope.access_json(menu.url);
		}else{
				scope.access_json(menu);
		}
	},500)
	
}
scope.getnotices=function(){
	scope.sysnotices =[];
	scope.get_data(
		function(data){
				if(data.error !=1){
						scope.sysnotices=data.list
						//console.log(scope.sysnotices);
						scope.$evalAsync();
				}else{
						console.log('error!');
				};
		},'','core/system.message/getsysnotices/'
		
	);
}
if(scope.main.isfounder){
	scope.getnotices();
}

scope.upnotice=function(){
	var params={
			plugin:'core',
			action:'system.message',
			op:'upnotice',
			callback:function(res){
				if(res.error!=1){
					scope.sysnotices =[];
					scope.$evalAsync();
					scope.message('更新成功！');
				}
			}
		}
	scope.post_json(params);
}
</script>